<?php

/**
 * Users
 */

$table = new UserModel();
/* delete all ! */foreach($table->fetchAll() as $row) $row->delete();

$table->insert(array('id'=>1,'login'=>'lightuser','password'=>'lightpasswd','email'=>'light@mydomain.com','firstname'=>'Light','lastname'=>'Name'));

/**
 * Feeds
 */

$table = new FeedModel();
/* delete all ! */foreach($table->fetchAll() as $row) $row->delete();

$table->insert(array('id'=>1,'name'=>'test','title'=>'Test feed','description'=>'This is the description of the test feed','created'=>date('Y-m-d H:i:s',time()),'updated'=>date('Y-m-d H:i:s',time()),'enabled'=>true));
$table->insert(array('id'=>2,'name'=>'test2','title'=>'Test feed 2','description'=>'This is the description of the test feed 2','created'=>date('Y-m-d H:i:s',time()),'updated'=>date('Y-m-d H:i:s',time()),'enabled'=>true));

/**
 * Entries
 */

$table = new EntryModel();
/* delete all ! */foreach($table->fetchAll() as $row) $row->delete();

$table->insert(array('id'=>1,'feed'=>1,'user'=>1,'title'=>'This is a test entry','link'=>'http://www.google.com','summary'=>'This is the summary of the test entry','created'=>date('Y-m-d H:i:s',time()),'enabled'=>true));
$table->insert(array('id'=>2,'feed'=>1,'user'=>1,'title'=>'This is a test entry 2','link'=>'http://www.yahoo.com','summary'=>'This is the summary of the test entry 2','created'=>date('Y-m-d H:i:s',time()),'enabled'=>true));
$table->insert(array('id'=>3,'feed'=>2,'user'=>1,'title'=>'This is a test entry 3','link'=>'http://www.microsoft.com','summary'=>'This is the summary of the test entry 3','created'=>date('Y-m-d H:i:s',time()),'enabled'=>true));

/**
 * Subscriptions
 */

$table = new SubscriptionModel();
/* delete all ! */foreach($table->fetchAll() as $row) $row->delete();

$table->insert(array('id'=>1,'feed'=>1,'user'=>1,'created'=>date('Y-m-d H:i:s',time()),'updated'=>date('Y-m-d H:i:s',time()),'enabled'=>true));

$table = null;